package com.twu.biblioteca.mocks;

import com.twu.biblioteca.controller.LibraryController;
import com.twu.biblioteca.domain.Withdrawable;

import java.util.Stack;


public class LibraryControllerMock<T extends Withdrawable> implements LibraryController<T> {
    public int withdrawItemCallCount = 0;
    public Stack<String> withdrawItemCallStack = new Stack<String>();
    public Stack<String> returnItemCallStack = new Stack<String>();
    public int returnItemCallCount = 0;
    public int printItemListCallCount = 0;
    public int printWithdrawnCallCount = 0;

    @Override
    public void printItemList() {
        this.printItemListCallCount++;
    }

    @Override
    public boolean withdrawItem(String s) {
        this.withdrawItemCallCount++;
        this.withdrawItemCallStack.push(s);
        return false;
    }

    @Override
    public boolean returnItem(String returnedBook) {
        this.returnItemCallCount++;
        returnItemCallStack.push(returnedBook);
        return false;
    }

    @Override
    public void printWithdrawn() {
        this.printWithdrawnCallCount++;

    }
}
